TMCMultiBitmap
TMCMultiBitmap Component

See also	Properties	Methods	Events

This Delphi VCL component is directed towards those of you who make programs that must display bitmaps in many resolutions without distorting them. The control can contain up to 5 bitmaps, one each for the common Windows resolutions (640x480, 800x600, 1024x768, 1280x1024 and 1600x1200).

The component has component editors that ease the task of loading and saving the multiple images, taking much of that drudgery off your shoulders. These editors can be reached by pressing the right button on the component in the form designer.

Selection of the appropriate image to display is completely automatic, depending on the screen resolution, and will go down to the nearest lower image if an ímage is not defined for the active resolution. That is, you can distribute a thin version with only the most common resolutions, and the component will display the smaller one if there isnt one for the current resolution.

As an added bonus feature, Ive given the component the ability to show transparent bitmaps, in the same way that Delphi does it - the color of the lower-left corner is treated as transparent.


Ordering information

Contacting the author


TMCMultiBitmap properties
Properties

Runtime only	Key proerty

		Align			Cursor			PopupMenu
		AutoSize			DragCursor			ReleaseUnusedBitmaps
		Bitmap640x480			DragMode			ShowHint
		Bitmap800x600			Enabled			Showing
		Bitmap1024x768			Height			Stretch
		Bitmap1280x1024			Hint			Tag
		Bitmap1600x1200			Left			Top
		BoundsRect			Name			Transparent
		Canvas			Owner			Visible
		Center			Parent			Width
		ComponentIndex			ParentShowHint


Bitmap property
Bitmap640x480 property

Declaration:

property Bitmap640x480: TBitmap;

property Bitmap800x600: TBitmap;

property Bitmap1024x768: TBitmap;

property Bitmap1280x1024: TBitmap;

property Bitmap1600x1200: TBitmap;

Description:

The five bitmap properties is used internally to store the pictures. I think youll prefer to use the SmartLoad/SmartSave options on the components right-click menu, it makes loading and saving all images at once a snap. These properties are mainly provided to facilitate easy inspection of the various images, just double-click it and Delphi will show it.

As you can see, there are bitmaps for the usual Windows resolutions. If a program using this component is ran on a system using some weird resolution like 1180x850, no image will be shown at all. For the resolutions supported, the component will go down automatically to the closest resolution for which an image is provided. This means you can distribute a lean version with only 640x480 images, and it will show these images even in 1600x1200.


ReleaseUnusedBitmaps property

Declaration:
property ReleaseUnusedBitmaps: boolean;

Description:

If you leave this property alone, its default value True will make the component automatically free the bitmaps that doesnt show in the current resolutions, once the correct one is determined. The only reason for not doing this is that you want to process the other bitmaps in some way, and free them later - in that case, ReleaseUnusedBitmapsNow is exactly what you need.


Transparent property

Declaration:

property Transparent: boolean;

Description:

As it name implies, setting this property to True makes the bitmap transparent, meaning that whatever is under it shows through. The method used to determine the color to be transparent is the same as the one used for Glyphs - the color of the lower left corner.


TMCMultiBitmap methods
Methods

Key method

	Create		ReleaseUnusedBitmapsNow
	Destroy


ReleaseUnusedBitmapsNow method

Declaration:
procedure ReleaseUnusedBitmapsNow;

Description:

Use this method to reduce runtime memory consumption by releasing the bitmaps not in use for the current resolution. This is highly recommended, and if you leave the ReleaseUnusedBitmaps at its default True setting it is done automatically.


TMCMultiBitmap Events
Events

OnClick	OnDragOver	OnMouseMove
OnDblClick	OnEndDrag	OnMouseUp
OnDragDrop	OnMouseDown


Ordering information

The registration fee for the component is $20 without source and $40 with source. This is for electronic registration only, you have to supply us with an electronic address (CompuServe, InterNet or FidoNet) to which we can send the registered version. If you want a disk, contact us!

Whatever way you do it, you receive the same benefits - a version that works outside the IDE. In addition your conscience will stop hurting, and youll be able to distribute programs using the component (unregistered version requires Delphi to be running).

You can register this pack in four ways:

CompuServe SWREG, register  #10736 (without source, $20) or #10737 (includes source, $40)

Sending check or money order drawn on a Swedish bank

Sending cash in an envelope (if you dare)

Direct bank transfer, using the below information:

Account 8313-9 3.441.335-1

Kristianstads Sparbank

Via SwedBank, Stockholm

Swift Code SWEDSESS

Our mailing adress is as follows (see Contacting the author for other addresses)

MegaComm HB
Att Christian Tiberg

V Storgatan 67A

S-291 53  Kristianstad

SWEDEN


Contacting the author

We can be reached through a lot of methods and addresses:

InterNet: megacomm@algonet.se

CompuServe: 100777,2775

FidoNet: 2:200/602

Phone: +46-44-103435

Fax/BBS: +46-44-125230

Snail mail:	MegaComm HB

Att Christian Tiberg

V Storgatan 67A

S-291 53  Kristianstad

SWEDEN